package com.thinktank.controller;

import java.io.*;

import javax.servlet.*;
import javax.servlet.http.*;

public class LogoutController implements Controller {

	@Override
	public String execute(HttpServletRequest request,
			HttpServletResponse response) throws IOException, ServletException {
		// 세션 무효화하고 쿠키 지우는건데 쿠키는 안됨
		System.out.println("로그아웃");
		HttpSession session = request.getSession();
		session.invalidate();

		Cookie noCookie = new Cookie("no", null);
		noCookie.setMaxAge(60 * 60 * 24);
		response.addCookie(noCookie);
		
		return "redirect:index/index.html";
	}

}
